{include file="public/header" /}
<style>
    .w-75 {
        width: 75%;
    }
    .pb-120 {
        margin-bottom: 120px;
    }
</style>
<body>
<div class="layui-fluid layui-anim-fadein pb-120">
    <form action="{:url('saveGroup')}" class="layui-form" lay-filter="builderForm" data-token="" data-nav="" data-just="false">
        <div class="layui-card ">
            <div class="layui-card-body">
                <div class="layui-tabs layui-tabs-brief">
                    <ul class="layui-tabs-header">
                        {foreach name=":get_config_group()" item="group" key="key"}
                        <li class="{eq name='$id' value='$key'}layui-this{/eq}"><a href="{:url('create',['id'=>$key])}">{$group}配置</a>
                        </li>
                        {/foreach}
                    </ul>
                </div>
                <div class="layui-tabs-body">
                    <div class=" w-75">
                        <div class="layui-row">
                            {foreach name="list" item="config"}
                            <?php $config['md'] = 12;?>
                            {switch name="config['type']"}

                            {case value="1"}
                            <?php echo builderFormInit($config)->getFormItemInputHtml();?>
                            {/case}

                            {case value="2"}
                            <?php echo builderFormInit($config)->getFormItemTextareaHtml();?>
                            {/case}

                            {case value="4"}
                            <?php $config['options'] = parse_config_attr($config['extra']);?>
                            <?php echo builderFormInit($config)->getFormItemSelectHtml();?>
                            {/case}

                            {case value="5"}
                            <?php echo builderFormInit($config)->getFormItemEditorHtml();?>
                            {/case}

                            {case value="6"}
                            <?php echo builderFormInit($config)->getFormItemImgHtml();?>
                            {/case}

                            {case value="7"}
                            <?php [$format,$range] = explode('_',$config['format']);?>
                            <?php echo builderFormInit($config)->getFormItemTimeHtml($format,$range == 2);?>
                            {/case}

                            {case value="8"}
                            <?php echo builderFormInit($config)->getFormItemInputHtml('number');?>
                            {/case}

                            {case value="10"}
                            <?php $config['options'] = [1 => "周一", 2 => "周二", 3 => "周三", 4 => "周四", 5 => "周五",
                            6 => "周六", 0 => "周日"];?>
                            <?php echo builderFormInit($config)->getFormItemCheckBoxHtml();?>
                            {/case}

                            {/switch}
                            {/foreach}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="clear: both;height: 300px;"></div>
        <div class="layui-footer">
            <button class="layui-btn layui-hide" lay-filter="builderFormSubmit" lay-submit>保存</button>
            <button class="layui-btn layui-btn-disabled loading" disabled>
                <i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop"></i>
                Loading...
            </button>
        </div>
    </form>
</div>
</body>
{include file="public/footer" /}
<script>
    layui.use(['edit'], function () {
        layui.edit.render();
    });
</script>
</html>